﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace ScrumMagic
{
    /// <summary>
    /// Interaction logic for FormWindow.xaml
    /// </summary>
    public partial class FormWindow : Window, ICommonContainer
    {
        private CommonForm commonform = null;

        public FormWindow(CommonForm CommonForm)
        {
            InitializeComponent();
            commonform = CommonForm;
            Title = CommonForm.Title;
            this.Width = CommonForm.Width;
            this.Height = CommonForm.Height;
            CommonForm.Height = double.NaN; //Height = "Auto"; // for all tab filling
            CommonForm.Width = double.NaN;
            Content = CommonForm;
        }
        
#region Implement ICommonContainer
        public string ContainerTitle
        {
            get {return Title ; }
        }

        public FormController.ContainerTypes Type
        {
            get { return FormController.ContainerTypes.window; }
        }

        public CommonForm CommonForm
        {
            get { return commonform; }
        }

        public void CloseContainer()
        {
            this.Close();
        }
        
        public void ActivateContainer()
        {
            this.Activate();
        }
#endregion
    }
}
